Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

C Programming Interviews Questions


C Language Function Question and Answer...

Q.1 What is a function in C programming?

Answer: A function is a self-contained block of code that performs a specific task and can be called from other parts of the program.

Q.2 What are the advantages of using functions?

Answer: Functions help in modularizing code, promoting code reuse, improving readability, and simplifying debugging and maintenance

Q.3 How do you declare a function in C?

Answer: You declare a function by specifying its return type, name, and parameters (if any) before using it in the program.

Q.4 What is a function prototype?

Answer: A function prototype is a declaration of a function that specifies its return type, name, and parameters without providing the function body. It tells the compiler about the existence and signature of the function.

Q.5 What is the purpose of a return statement in a function?

Answer: The return statement is used to exit a function and optionally return a value to the caller.

Q.6 What is the difference between formal parameters and actual parameters?

Answer: Formal parameters are the parameters declared in the function definition, while actual parameters are the values passed to the function when it is called.

Q.7 What is function overloading?

Answer: Function overloading is a feature that allows multiple functions with the same name but different parameter lists to coexist in the same scope.

Q.8 What is the base case in recursion?

Answer: The base case is a condition in a recursive function where the function stops calling itself and returns a value without further recursion.

Q.9 How do you pass parameters to a function by reference?

Answer: Parameters passed by reference (using pointers) allow the function to modify the original values of the variables passed as arguments.

Q.10 What is a function pointer?

Answer: A function pointer is a variable that stores the address of a function.




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML 5

Python

java

C++

C

JavaScript

Campus Learning

C

C#

java